#import "BWFrenchKnot.h"

@implementation BWFrenchKnot


- (id) initWithX: (int) newX
               y: (int) newY
{
    if ([super init] == nil) {
        return (nil);
    }

    x = newX;
    y = newY;

    return (self);

} // initWithX


+ (BWFrenchKnot *) newKnotAtX: (int) x
                            y: (int) y
{
    BWFrenchKnot *knot;
    knot = [[self alloc] initWithX: x  y: y];

    return ([knot autorelease]);

} // newKnotAtX



- (int) x
{
    return (x);
} // x

- (void) setX: (int) newX
{
    x = newX;
} // setX


- (int) y
{
    return (y);
} // y


- (void) setY: (int) newY
{
    y = newY;
} // setY


- (void) encodeWithCoder: (NSCoder *) coder
{
    [coder encodeInt: x  forKey: @"x"];
    [coder encodeInt: y  forKey: @"y"];

#if 0
    [coder encodeObject: color  forKey: @"color"];
#endif

} // encodeWithCoder


- (id) initWithCoder: (NSCoder *) coder
{
    if (self = [super init]) {

        x = [coder decodeIntForKey: @"x"];
        y = [coder decodeIntForKey: @"y"];
#if 0
        color = [coder decodeObjectForKey: @"color"];
#endif
    }

    return (self);

} // initWithCoder



@end // BWFrenchKnot

